% core_1_VIMS.m
%
% mfile to process core_1
% provides core specific information needed in processing as well as some
% basic metadata
%
% by Patrick Dickhudt - Jan. 2011  pdickhudt@usgs.gov
%
% filter and data file names
dfld = '/Users/kafall/Desktop/GUST Microcosm/YR110720/GUST Microcosm'; % folder containing data file
ffld = '/Users/kafall/Desktop/GUST Microcosm/YR110720/GUST Microcosm/TSS filters'; % folder containing filter file

filein = fullfile(dfld,'Claybank_mc_jul202011.txt');   % time series data file
filein2 = fullfile(ffld,'S4937filter.csv');  % filter data file

% Bottle switch times -- these are the times that the water first enters
% the bottles They are EDT. Computer is NOT set for EST.
%NOTE: This is actually as EST since the computer for this run was set as
%EST but the Erosion log sheet was recorded as EDT.
day = '07/20/2011';
tstr{1}=[day ' 12:50:00'];  % 0.01 tau  %verify start time from the file. this time must be After the first record time
tstr{2}=[day ' 13:20:00']; % 0.05 
tstr{3}=[day ' 13:40:00']; % 0.1
tstr{4}=[day ' 14:00:00']; % 0.2
tstr{5}=[day ' 14:20:00']; % 0.3
tstr{6}=[day ' 14:40:00']; % 0.45
tstr{7}=[day ' 15:00:00']; % 0.54
tstr{8}=[day ' 15:27:00']; % end time of last step.  check times in file!



% make struct with core specific info

% the following need to be editted for each core
crinfo.ntun = 1;                    % turbidimeter number (1 or 2) --- core A is typically 1 and core B is typically 2
crinfo.rpmn = 1;                    % motor number (1 or 2) --- core A is typically 1 and core B is typically 2
crinfo.subsamp = 'n';               % were bottle samples subsamples 'y' or 'n'
crinfo.coren = 'S4937_CoreA';         % core number
crinfo.titlestr ='S4937 Core A';       % for labelling plots - replace underscores with dashes etc. to improve appearance
crinfo.temp = 25.5;                   % water temp (C)
crinfo.lat = 37.34088;              % latitude
crinfo.lon = -76.62478;             % longitude
%crinfo.depth = ;                 % approximate depth (m)
crinfo.time  = '20-Jul-2011 09:44'; % core collection time... in STANDARD TIME!!! EST for east coast.
% the time here has been ajusted to EST.
crinfo.corer = 'GOMEX box-core with sub-core';% coring device
crinfo.vessel = 'R/V Heron';     % coring platform
crinfo.op = 'K.Fall';     % operator
crinfo.timebase = 'EDT';            % time base (it is OK if use clock time for analysis)

% note any relevant info, core description, etc.
crinfo.note = {%'Turb to bottle tube length = 100 cm';
               %'Nice core';
               %'nearly level surface';
               %'~ 4 mm surface relief';
               %'slightly hummocky surface';
               %'some worm tubes'
               };
           
% the following are general and likely apply to all cores for a given
% system
crinfo.system = {'VIMS'}; % erosion system used
crinfo.tube = 100;  % turbidimeter to bottle tube length (cm)
crinfo.tstr = tstr;
crinfo.nsteps=7;
%crinfo.Aeff=0.0088382; %[m^2] effective area of sediment surface in core. - 4.5 inch OD tube (slow corer)
crinfo.Aeff=0.0068337; %[m^2] effective area of sediment surface in core. - 4 inch OD tube (multicorer)
%VIMS SYSTEM uses 4 inch OD tubes

crinfo.fields = {'crinfo = core / system specific data';
                 'ntun = turbidimeter number (1 or 2)';
                 'rpmn = motor number (1 or 2)';
                 'subsamp = were bottle samples subsamples y or n (string)';
                 'coren = core number';
                 'titlestr = for labelling plots - replace underscores with dashes etc. to improve appearance';
                 'temp = water temp (C)';
                 'lat = latitude';
                 'lon = longitude';
                 'depth = approximate depth (m)';
                 'time = core collection time';
                 'corer = coring device';
                 'vessel = coring platform';
                 'op = operator';
                 'timebase = time base (GMT,EST, etc.)';
                 'note = relevant info, core description, etc.';
                 'system = erosion system used';
                 'tube = turbidimeter to bottle tube length (cm)';
                 'tstr = bottle switch times';
                 'nsteps = number of steps';
                 'Aeff = [m^2] effective area of sediment surface in core'};


[tsdat,stepdat,erdat,fitdat]=procerode3_VIMS(filein,filein2,crinfo);

close('all')


open([crinfo.coren '_er.fig'])
open(['M_' crinfo.coren '.fig'])
open(['tau_' crinfo.coren '.fig'])
